const { Result } = require("../util/result");
const express = require('express');
const router = express.Router();
const db = require('../util/db');
const { log } = require("debug");
const res = require("express/lib/response");

router.get('/',  (req, res) => {
    db.query('SELECT * FROM category', (err, result) => {
        if (err) {
            res.json(new Result(500, '服务器错误', err))
        } else {
            res.json(new Result(200, '查询成功', result));
        }
    });
});

module.exports=router